package com.example.cola.domain.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户ID值对象
 * 
 * @author 资深开发专家
 * @version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserId {
    
    private Long value;
    
    public static UserId of(Long value) {
        if (value == null || value <= 0) {
            throw new IllegalArgumentException("用户ID不能为空或小于等于0");
        }
        return new UserId(value);
    }
    
    @Override
    public String toString() {
        return String.valueOf(value);
    }
}
